<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    <title>销售商品</title>
</head>

<body>

<!--{include file='comm/naviBanner.tpl'}-->

<div class="ebsig_container">

    <!--{include file='comm/menu.tpl'}-->
    <div class="comm_content">

            <div class="search-box">
                <div style="position:relative">
                    <form id="search_form" onsubmit="return false;">
                        <table>
                            <tbody>
                                <tr>
                                    <td>
                                        <span>商家编号：<input type="text" id="product_code" name="product_code" value="" style="width:120px;"/></span>
                                        <span>商品名称：<input type="text" id="goodsName" name="goodsName" value="" style="width:350px;"/></span>
                                        <span>销售价：  <input type="text" id="startPrice" name="startPrice" value="" style="width:60px;"/> ～<input type="text" id="endPrice" name="endPrice" value="" style="width:60px;"/></span>
                                        <span>
                                            品牌：
                                            <select style="width:120px;" id="brandID" name="brandID">
                                                <option value="0">请选择</option>
                                                <!--{foreach from=$goodsInfo->brandList item=b_l}-->
                                                <option value="<!--{$b_l->brandID}-->"><!--{$b_l->brandName}--></option>
                                                <!--{/foreach}-->
                                            </select>
                                        </span>
                                        <br>
                                        <span style="margin:0">商品分类：</span>
                                        <span style="vertical-align:middle;"><!--{$goodsInfo->category}--></span>
                                        
                                        <span><input type="button" value="查询" class="btn" onclick="goods.search();" /></span>
                                        <span><input type="button" value="重置" class="btn" onclick="goods.reset();" /></span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>

            <table id="flex" style="display:none"></table>

        </div>

</div>


<script type="text/javascript">
    $("#flex").flexigrid({
        url:"/invokingAjax-backend/goods/goods.ajax?operFlg=2&xjx=none",
        dataType: "json",
        colModel : [
            {display: "操作", width : 140, align: "center"},
            {display: "商家编码", width : 120, align: "left"},
            {display: "商品名称", width : 480},
            {display: "大分类", width : 90 },
            {display: "中分类", width : 90},
            {display: "小分类", width : 90},
            {display: "市场价", width : 90},
            {display: "销售价", width : 90}
        ],
        sortname: "timeStamp",
        sortorder: "desc",
        usepager: true,
        rp: 20,
        useRp: true,
        showTableToggleBtn: true,
        onSubmit: function() {
            var dt = $('#search_form').serializeArray();
            $("#flex").flexOptions({params: dt});
            $(".bDiv").height('600');
            return true;
        }
    });
	
    var goods = {
		postID_str  : "" ,
		do_flg 	    : 0  ,
		publish_uid : 0 ,
		publish_url : "" ,
        //商品列表
        search: function() {
            var dt = $('#search_form').serializeArray();
            $("#flex").flexOptions({params: dt}).flexReload();
        },
		
        //商品详情
        details: function(postID) {
            E.open("/quanliadmin/app/goods/goodsSale.pscript?operFlg=2&postID=" + postID , "", {height: 600,width: 1062, top: 50, left: 150});
        },
       
        edit: function(brandID) {
            E.open("/quanliadmin/app/goods/goodsBrand.pscript?operFlg=3&brandID=" + brandID, "", {height: 600,width: 1024, top: 50, left: 150});
        },
        
		publish:function (uid , publish_url){
			this.publish_uid = uid;
			this.publish_url = publish_url;
			
			E.confirm("您确认要发布商品缓存吗？", "goods.publishConfirm");
		},

		publishConfirm:function () {
			var link = "/shop/goods.php?uid=" + this.publish_uid +"&"+ this.publish_url + '&subsite=shop' ;
			window.open(link,"_blank") ;
		},

		preview:function (uid , preview_url){
			var link = "/shop/goods.php?uid=" + uid +"&"+ preview_url + '&subsite=shop' ;
			window.open(link,"_blank") ;
		},

        load: function() {
            $("#flex").flexReload();
        },
        
        reset : function(){
        	$('#postID').val('');
        	$('#goodsName').val('');
        	$('#startPrice').val('');
        	$('#endPrice').val('');
        	$('#bigCate').val('');
        	$('#midCate').val('');
        	$('#smallCate').val('');
        	$('#brandID').val('');
        	$('#product_code').val('');
        }
		
    };
</script>
</body>
</html>